package com.example.user.controller;

import cn.hutool.core.lang.UUID;
import cn.hutool.json.JSONUtil;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description TODO
 * @Author JFeng
 * @Date 2024/4/19
 */

@RestController
@RequestMapping("/stock")
public class StockController {

    @RequestMapping("/reduce/{quantity}")
    public String reduce(@PathVariable Integer quantity) {
        Map<Object, Object> map = new HashMap<>();
        map.put("StockService", UUID.fastUUID().toString());
        map.put("quantity", quantity);
        return JSONUtil.toJsonStr(map);
    }


}
